home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / libs / halt.lzh / halt / halt.h < prev    next >
C/C++ Source or Header  |  1995-10-06  |  2KB  |  73 lines

  1. /*
  2.    halt.h --- halt library definitions.
  3.  
  4.    (c) Copyright 1995 SHW Wabnitz
  5.    Written by Bernhard Fastenrath (fasten@shw.com)
  6.  
  7.    This file may be distributed under the terms
  8.    of the GNU General Public License.
  9. */
  10.  
  11. #ifndef HALT_H
  12. #define HALT_H
  13.  
  14. /* definitions for the sm_Status field:
  15.    SHUTDOWN_WARN:   system might go down
  16.    SHUTDOWN_INFO:   check sm_Info field
  17.    SHUTDOWN_ABORT:  shutdown cancelled
  18.    SHUTDOWN_NOW:    system is going down in a few seconds
  19.    SHUTDOWN_UMOUNT: accessing files is pointless from now on
  20.    SHUTDOWN_HALT:   the system is down
  21. */
  22. #define SHUTDOWN_WARN   0x01
  23. #define SHUTDOWN_INFO   0x02
  24. #define SHUTDOWN_ABORT  0x04
  25. #define SHUTDOWN_NOW    0x08
  26. #define SHUTDOWN_UMOUNT 0x10
  27. #define SHUTDOWN_HALT   0x20
  28.  
  29. /* definitions for the sm_Info field:
  30.    SDMI_UPS_MONITOR: UPS monitor report (sm_Extra points to struct UpsInfo)
  31.    SDMI_TIME_CHANGE: Shutdown has been speed up or delayed.
  32. */
  33. #define SDMI_UPS_MONITOR 0x01
  34. #define SDMI_TIME_CHANGE 0x02
  35.  
  36. /* definitions for the sm_Flags field (version 1.1):
  37.    SDMF_ABORTABLE: set by master to allow clients to cancel the shutdown
  38.    SDMF_CANCEL:    set by client to cancel shutdown
  39.    SDMF_CTRL_C:    CTRL-C received, set together with SDMF_CANCEL
  40.    SDMF_SIG_MASK:  A signal set in sm_Mask was received
  41. */
  42. #define SDMF_ABORTABLE 0x01
  43. #define SDMF_CANCEL    0x02
  44. #define SDMF_CTRL_C    0x04
  45. #define SDMF_SIG_MASK  0x08
  46.  
  47. typedef struct { /* version 2.0 */
  48.   ULONG           sc_Mask;
  49.   ULONG           sc_rMask;
  50.   struct MsgPort *sc_Port;
  51.   ULONG           sc_TimeOuts;
  52.   struct List     sc_List;
  53.   ULONG           sc_Reserved[8];
  54. } ShutdownContext;
  55.  
  56. typedef struct {
  57.   struct Message   sm_Msg;
  58.   ULONG            sm_Status;
  59.   ULONG            sm_TimeLeft;
  60.   ULONG            sm_Info;
  61.   void            *sm_Extra;
  62.   ULONG            sm_Flags;   /* v1.1 */
  63.   ShutdownContext *sm_Context; /* v2.0 */
  64.   ULONG            sm_Reserved[2];
  65. } ShutdownMessage;
  66.  
  67. typedef struct {
  68.   struct MinNode   sn_MinNode;
  69.   ShutdownMessage  sn_Msg;
  70. } ShutdownNode;
  71.  
  72. #endif /* HALT_H */
  73.